package com.button.boot.redis.jedis.service.impl;

import java.util.concurrent.TimeUnit;

import javax.annotation.Resource;

import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import com.button.boot.redis.jedis.service.RedisManager;

@Service
public class RedisManagerImpl implements RedisManager {
    @Resource(name="stringRedisTemplate")
    private StringRedisTemplate strRedisTemplate;
    
    @Override
    public String valueGet(String key){
        return strRedisTemplate.opsForValue().get(key);
    }

    @Override
    public void valueSet(String key, String value, Integer timeout, TimeUnit timeUnit) {
        strRedisTemplate.opsForValue().set(key, value, timeout, timeUnit);
    }
}
